<?php
require_once 'config.php';
require_once 'function.php';
require_once 'class/Mysql.class.php';

$db = new Mysql();

$arr = array(
	'PDF to PowerPoint Converter'=>'Video Converter Ultimate for Mac9',
	'DVD Audio Ripper for Mac'	=>'Free YouTube Downloader for Mac9',
	'iCamera 2010 for iPhone'	=>'DVD to iPhone Converter for Mac9',
	'Free Transpod for Mac'		=>'Video to iPod Converter for Mac9',
	'PDF Password Remover'		=>'DVD Slideshow Builder Standard9',
	'PDF to EPUB for Mac'		=>'Flash Gallery Factory Standard9',
	'AllMyMusic for Mac'		=>'DVD to iPod Converter for Mac9',
	'QuizCreator Free'			=>'DVD to iPad Converter for Mac9',
	'LiveBoot 2012'				=>'iPhone Ringtone Maker for Mac9',
	'DVD Creator'				=>'PDF Password Remover for Mac9',
	'iMate'						=>'iPad Video Converter for Mac9'
);

$sql = array();

foreach ( $arr as $k=>$v ){
	
	/*
	$sql[] = "update topic_article set 
		ar_title = replace(ar_title,'{$v}','{$k}'),
		ar_subtitle = replace(ar_subtitle,'{$v}','{$k}'),
	    ar_introduction = replace(ar_introduction,'{$v}','{$k}'),
	    ar_content = replace(ar_content,'{$v}','{$k}'),
	    ar_page_keyword = replace(ar_page_keyword,'{$v}','{$k}'),
	    ar_page_description = replace(ar_page_description,'{$v}','{$k}')
	    where is_translate = 1";*/
	
	//product_support_content,product_ad,product_intro,product_content,product_key_feature,product_guide_content,techspec_content_table,product_contrast_table
	/*$sql[] = "update product set 
		product_support_content = replace(product_support_content,'{$v}','{$k}'),
		product_ad = replace(product_ad,'{$v}','{$k}'),
	    product_intro = replace(product_intro,'{$v}','{$k}'),
	    product_content = replace(product_content,'{$v}','{$k}'),
	    product_key_feature = replace(product_key_feature,'{$v}','{$k}'),
	    product_guide_content = replace(product_guide_content,'{$v}','{$k}'),
	    techspec_content_table = replace(techspec_content_table,'{$v}','{$k}'),
	    product_contrast_table = replace(product_contrast_table,'{$v}','{$k}')
	    where is_translate = 1";*/
	
	
	//advantages_content,tips,ad_guide
/*	$sql[] = "update won_product set 
		advantages_content = replace(advantages_content,'{$v}','{$k}'),
		tips = replace(tips,'{$v}','{$k}'),
	    ad_guide = replace(ad_guide,'{$v}','{$k}')
	    where is_translate = 1";*/
	
	//feature_title,feature_intro
/*	$sql[] = "update feature set 
		feature_title = replace(feature_title,'{$v}','{$k}'),
		feature_intro = replace(feature_intro,'{$v}','{$k}')
	    where is_translate = 1";*/
	
	
	//page_title,page_content
/*	$sql[] = "update product_page set 
		page_title = replace(page_title,'{$v}','{$k}'),
		page_content = replace(page_content,'{$v}','{$k}')
	    where is_translate = 1";*/
	
	//table_13
/*	$sql[] = "update Table_13 set 
		Field_19978 = replace(Field_19978,'{$v}','{$k}'),
		Field_19964 = replace(Field_19964,'{$v}','{$k}'),
		Field_19914 = replace(Field_19914,'{$v}','{$k}'),
		Field_19915 = replace(Field_19915,'{$v}','{$k}')
	    where is_translate = 1";*/
	
		//table_26
	$sql[] = "update Table_26 set 
		Field_20046 = replace(Field_20046,'{$v}','{$k}'),
		Field_20047 = replace(Field_20047,'{$v}','{$k}'),
		Field_20048 = replace(Field_20048,'{$v}','{$k}')
	    where is_translate = 1";
}

foreach( $sql as $v ){
	$db->query( $v );
}

